/**
 * 
 */
package com.woman.beautylive.util;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

/**
 * 显示隐藏键盘工具类
 * @author mr.w
 * 
 */
public class SoftwareUtil {
	public static void showOrHideSoftware(View view, Context context,
			boolean isShow) {
		InputMethodManager imm = (InputMethodManager) context
				.getSystemService(Context.INPUT_METHOD_SERVICE);
		if (isShow) {
			imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
		}
		else {
			imm.hideSoftInputFromWindow(view.getWindowToken(), 0); // 强制隐藏键盘
		}
	}
	   public static boolean isImeShow(Context context){
	        InputMethodManager imm = (InputMethodManager) context.getSystemService(context.INPUT_METHOD_SERVICE);
	        return imm.isActive();
	    }
}
